/**
 * @author LYJ
 * Created by Administrator on 2018/3/1 0001.
 */
function BootstrapValidateBaseForm($form,$error) {
    var This = this;
    this.type = null;
    this.$form = $form;
    this.$error = $error;

    /**
     * 配置
     * @type {{}}
     */
    this.option = {};

    this.run = function () {
      this.ajaxForm.start();
    };
    
    /**
     * 设置表单类型
     * @param type
     */
    this.setType = function (type) {
        if (type == null || type == This.type) {
            return;
        }
        This.type = type;
        this.init.start();
    };

    /**
     * 验证表单
     */
    this.validate = function () {
        This.$form.bootstrapValidator('validate');
    };

    /**
     * 获取表单指定name的input元素
     * @param name
     * @returns {*|{set, expr}|{ID, NAME, TAG}|{}|{ID, TAG}}
     */
    this.param = function (name) {
        return this.$form.find("[name='"+name+"']");
    };

    /**
     * 获取表单指定class的元素
     * @param name
     */
    this.element = function (name) {
        return this.$form.find("."+name);
    };
}